import request from '@/utils/request'

const url1 = 'http://192.168.10.100:9881/authorize'
const url2 = 'http://192.168.10.100:9881/rabc'

export function login(data) {
  return request({
    url: url1 + '/user/login',
    // url: '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: url2 + '/user/info',
    method: 'get',
    params: { token },
    headers: { token: token }
  })
}

export function getUserByToken(token) {
  return request({
    url: url2 + '/user/getUserByToken',
    method: 'get',
    params: { token },
    headers: { token: token }
  })
}

export function logout() {
  return request({
    url: url2 + '/user/logout',
    method: 'post'
  })
}
